3.1.71 \(\int \frac {\csc (e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\) [71]

3.1.71.1 Optimal result
3.1.71.2 Mathematica [A] (verified)
3.1.71.3 Rubi [A] (verified)
3.1.71.4 Maple [A] (verified)
3.1.71.5 Fricas [B] (verification not implemented)
3.1.71.6 Sympy [F]
3.1.71.7 Maxima [F(-2)]
3.1.71.8 Giac [B] (verification not implemented)
3.1.71.9 Mupad [B] (verification not implemented)

3.1.71.1 Optimal result

Integrand size = 21, antiderivative size = 110 \[ \int \frac {\csc (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=-\frac {(3 a-2 b) \sqrt {b} \arctan \left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{2 a^2 (a-b)^{3/2} f}-\frac {\text {arctanh}(\cos (e+f x))}{a^2 f}-\frac {b \sec (e+f x)}{2 a (a-b) f \left (a-b+b \sec ^2(e+f x)\right )} \]

output
-arctanh(cos(f*x+e))/a^2/f-1/2*b*sec(f*x+e)/a/(a-b)/f/(a-b+b*sec(f*x+e)^2) 
-1/2*(3*a-2*b)*arctan(sec(f*x+e)*b^(1/2)/(a-b)^(1/2))*b^(1/2)/a^2/(a-b)^(3 
/2)/f
 
3.1.71.2 Mathematica [A] (verified)

Time = 1.55 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.67 \[ \int \frac {\csc (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {\frac {(3 a-2 b) \sqrt {b} \arctan \left (\frac {\sqrt {a-b}-\sqrt {a} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {b}}\right )}{(a-b)^{3/2}}+\frac {(3 a-2 b) \sqrt {b} \arctan \left (\frac {\sqrt {a-b}+\sqrt {a} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {b}}\right )}{(a-b)^{3/2}}-\frac {2 a b \cos (e+f x)}{(a-b) (a+b+(a-b) \cos (2 (e+f x)))}-2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )+2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 a^2 f} \]

input
Integrate[Csc[e + f*x]/(a + b*Tan[e + f*x]^2)^2,x]
 
output
(((3*a - 2*b)*Sqrt[b]*ArcTan[(Sqrt[a - b] - Sqrt[a]*Tan[(e + f*x)/2])/Sqrt 
[b]])/(a - b)^(3/2) + ((3*a - 2*b)*Sqrt[b]*ArcTan[(Sqrt[a - b] + Sqrt[a]*T 
an[(e + f*x)/2])/Sqrt[b]])/(a - b)^(3/2) - (2*a*b*Cos[e + f*x])/((a - b)*( 
a + b + (a - b)*Cos[2*(e + f*x)])) - 2*Log[Cos[(e + f*x)/2]] + 2*Log[Sin[( 
e + f*x)/2]])/(2*a^2*f)
 
3.1.71.3 Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.11, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 4147, 25, 316, 25, 397, 218, 219}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\csc (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sin (e+f x) \left (a+b \tan (e+f x)^2\right )^2}dx\)

\(\Big \downarrow \) 4147

\(\displaystyle \frac {\int -\frac {1}{\left (1-\sec ^2(e+f x)\right ) \left (b \sec ^2(e+f x)+a-b\right )^2}d\sec (e+f x)}{f}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {\int \frac {1}{\left (1-\sec ^2(e+f x)\right ) \left (b \sec ^2(e+f x)+a-b\right )^2}d\sec (e+f x)}{f}\)

\(\Big \downarrow \) 316

\(\displaystyle \frac {\frac {\int -\frac {-b \sec ^2(e+f x)+2 a-b}{\left (1-\sec ^2(e+f x)\right ) \left (b \sec ^2(e+f x)+a-b\right )}d\sec (e+f x)}{2 a (a-b)}-\frac {b \sec (e+f x)}{2 a (a-b) \left (a+b \sec ^2(e+f x)-b\right )}}{f}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {-\frac {\int \frac {-b \sec ^2(e+f x)+2 a-b}{\left (1-\sec ^2(e+f x)\right ) \left (b \sec ^2(e+f x)+a-b\right )}d\sec (e+f x)}{2 a (a-b)}-\frac {b \sec (e+f x)}{2 a (a-b) \left (a+b \sec ^2(e+f x)-b\right )}}{f}\)

\(\Big \downarrow \) 397

\(\displaystyle \frac {-\frac {\frac {2 (a-b) \int \frac {1}{1-\sec ^2(e+f x)}d\sec (e+f x)}{a}+\frac {b (3 a-2 b) \int \frac {1}{b \sec ^2(e+f x)+a-b}d\sec (e+f x)}{a}}{2 a (a-b)}-\frac {b \sec (e+f x)}{2 a (a-b) \left (a+b \sec ^2(e+f x)-b\right )}}{f}\)

\(\Big \downarrow \) 218

\(\displaystyle \frac {-\frac {\frac {2 (a-b) \int \frac {1}{1-\sec ^2(e+f x)}d\sec (e+f x)}{a}+\frac {\sqrt {b} (3 a-2 b) \arctan \left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{a \sqrt {a-b}}}{2 a (a-b)}-\frac {b \sec (e+f x)}{2 a (a-b) \left (a+b \sec ^2(e+f x)-b\right )}}{f}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {-\frac {\frac {\sqrt {b} (3 a-2 b) \arctan \left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{a \sqrt {a-b}}+\frac {2 (a-b) \text {arctanh}(\sec (e+f x))}{a}}{2 a (a-b)}-\frac {b \sec (e+f x)}{2 a (a-b) \left (a+b \sec ^2(e+f x)-b\right )}}{f}\)

input
Int[Csc[e + f*x]/(a + b*Tan[e + f*x]^2)^2,x]
 
output
(-1/2*(((3*a - 2*b)*Sqrt[b]*ArcTan[(Sqrt[b]*Sec[e + f*x])/Sqrt[a - b]])/(a 
*Sqrt[a - b]) + (2*(a - b)*ArcTanh[Sec[e + f*x]])/a)/(a*(a - b)) - (b*Sec[ 
e + f*x])/(2*a*(a - b)*(a - b + b*Sec[e + f*x]^2)))/f
 

3.1.71.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 316
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim 
p[(-b)*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q + 1)/(2*a*(p + 1)*(b*c - a*d)) 
), x] + Simp[1/(2*a*(p + 1)*(b*c - a*d))   Int[(a + b*x^2)^(p + 1)*(c + d*x 
^2)^q*Simp[b*c + 2*(p + 1)*(b*c - a*d) + d*b*(2*(p + q + 2) + 1)*x^2, x], x 
], x] /; FreeQ[{a, b, c, d, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &&  ! 
( !IntegerQ[p] && IntegerQ[q] && LtQ[q, -1]) && IntBinomialQ[a, b, c, d, 2, 
 p, q, x]
 

rule 397
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ 
Symbol] :> Simp[(b*e - a*f)/(b*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[ 
(d*e - c*f)/(b*c - a*d)   Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e 
, f}, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4147
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^ 
(p_.), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Simp[1/(f*ff^ 
m)   Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m + 1 
)), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[( 
m - 1)/2]
 
3.1.71.4 Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.16

method result size
derivativedivides \(\frac {\frac {b \left (-\frac {a \cos \left (f x +e \right )}{2 \left (a -b \right ) \left (a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b \right )}+\frac {\left (3 a -2 b \right ) \arctan \left (\frac {\left (a -b \right ) \cos \left (f x +e \right )}{\sqrt {b \left (a -b \right )}}\right )}{2 \left (a -b \right ) \sqrt {b \left (a -b \right )}}\right )}{a^{2}}-\frac {\ln \left (\cos \left (f x +e \right )+1\right )}{2 a^{2}}+\frac {\ln \left (\cos \left (f x +e \right )-1\right )}{2 a^{2}}}{f}\) \(128\)
default \(\frac {\frac {b \left (-\frac {a \cos \left (f x +e \right )}{2 \left (a -b \right ) \left (a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b \right )}+\frac {\left (3 a -2 b \right ) \arctan \left (\frac {\left (a -b \right ) \cos \left (f x +e \right )}{\sqrt {b \left (a -b \right )}}\right )}{2 \left (a -b \right ) \sqrt {b \left (a -b \right )}}\right )}{a^{2}}-\frac {\ln \left (\cos \left (f x +e \right )+1\right )}{2 a^{2}}+\frac {\ln \left (\cos \left (f x +e \right )-1\right )}{2 a^{2}}}{f}\) \(128\)
risch \(-\frac {b \left ({\mathrm e}^{3 i \left (f x +e \right )}+{\mathrm e}^{i \left (f x +e \right )}\right )}{a f \left (-a +b \right ) \left (-a \,{\mathrm e}^{4 i \left (f x +e \right )}+b \,{\mathrm e}^{4 i \left (f x +e \right )}-2 a \,{\mathrm e}^{2 i \left (f x +e \right )}-2 b \,{\mathrm e}^{2 i \left (f x +e \right )}-a +b \right )}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{a^{2} f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{a^{2} f}+\frac {3 i \sqrt {b \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {b \left (a -b \right )}\, {\mathrm e}^{i \left (f x +e \right )}}{a -b}+1\right )}{4 \left (a -b \right )^{2} f a}-\frac {i \sqrt {b \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {b \left (a -b \right )}\, {\mathrm e}^{i \left (f x +e \right )}}{a -b}+1\right ) b}{2 \left (a -b \right )^{2} f \,a^{2}}-\frac {3 i \sqrt {b \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {b \left (a -b \right )}\, {\mathrm e}^{i \left (f x +e \right )}}{a -b}+1\right )}{4 \left (a -b \right )^{2} f a}+\frac {i \sqrt {b \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {b \left (a -b \right )}\, {\mathrm e}^{i \left (f x +e \right )}}{a -b}+1\right ) b}{2 \left (a -b \right )^{2} f \,a^{2}}\) \(392\)

input
int(csc(f*x+e)/(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
 
output
1/f*(b/a^2*(-1/2*a/(a-b)*cos(f*x+e)/(a*cos(f*x+e)^2-b*cos(f*x+e)^2+b)+1/2* 
(3*a-2*b)/(a-b)/(b*(a-b))^(1/2)*arctan((a-b)*cos(f*x+e)/(b*(a-b))^(1/2)))- 
1/2/a^2*ln(cos(f*x+e)+1)+1/2/a^2*ln(cos(f*x+e)-1))
 
3.1.71.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 215 vs. \(2 (98) = 196\).

Time = 0.38 (sec) , antiderivative size = 470, normalized size of antiderivative = 4.27 \[ \int \frac {\csc (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\left [-\frac {2 \, a b \cos \left (f x + e\right ) - {\left ({\left (3 \, a^{2} - 5 \, a b + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a b - 2 \, b^{2}\right )} \sqrt {-\frac {b}{a - b}} \log \left (\frac {{\left (a - b\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (a - b\right )} \sqrt {-\frac {b}{a - b}} \cos \left (f x + e\right ) - b}{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + b}\right ) + 2 \, {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + a b - b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 2 \, {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + a b - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{4 \, {\left ({\left (a^{4} - 2 \, a^{3} b + a^{2} b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b - a^{2} b^{2}\right )} f\right )}}, -\frac {a b \cos \left (f x + e\right ) + {\left ({\left (3 \, a^{2} - 5 \, a b + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a b - 2 \, b^{2}\right )} \sqrt {\frac {b}{a - b}} \arctan \left (-\frac {{\left (a - b\right )} \sqrt {\frac {b}{a - b}} \cos \left (f x + e\right )}{b}\right ) + {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + a b - b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + a b - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, {\left ({\left (a^{4} - 2 \, a^{3} b + a^{2} b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b - a^{2} b^{2}\right )} f\right )}}\right ] \]

input
integrate(csc(f*x+e)/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")
 
output
[-1/4*(2*a*b*cos(f*x + e) - ((3*a^2 - 5*a*b + 2*b^2)*cos(f*x + e)^2 + 3*a* 
b - 2*b^2)*sqrt(-b/(a - b))*log(((a - b)*cos(f*x + e)^2 + 2*(a - b)*sqrt(- 
b/(a - b))*cos(f*x + e) - b)/((a - b)*cos(f*x + e)^2 + b)) + 2*((a^2 - 2*a 
*b + b^2)*cos(f*x + e)^2 + a*b - b^2)*log(1/2*cos(f*x + e) + 1/2) - 2*((a^ 
2 - 2*a*b + b^2)*cos(f*x + e)^2 + a*b - b^2)*log(-1/2*cos(f*x + e) + 1/2)) 
/((a^4 - 2*a^3*b + a^2*b^2)*f*cos(f*x + e)^2 + (a^3*b - a^2*b^2)*f), -1/2* 
(a*b*cos(f*x + e) + ((3*a^2 - 5*a*b + 2*b^2)*cos(f*x + e)^2 + 3*a*b - 2*b^ 
2)*sqrt(b/(a - b))*arctan(-(a - b)*sqrt(b/(a - b))*cos(f*x + e)/b) + ((a^2 
 - 2*a*b + b^2)*cos(f*x + e)^2 + a*b - b^2)*log(1/2*cos(f*x + e) + 1/2) - 
((a^2 - 2*a*b + b^2)*cos(f*x + e)^2 + a*b - b^2)*log(-1/2*cos(f*x + e) + 1 
/2))/((a^4 - 2*a^3*b + a^2*b^2)*f*cos(f*x + e)^2 + (a^3*b - a^2*b^2)*f)]
 
3.1.71.6 Sympy [F]

\[ \int \frac {\csc (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\int \frac {\csc {\left (e + f x \right )}}{\left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2}}\, dx \]

input
integrate(csc(f*x+e)/(a+b*tan(f*x+e)**2)**2,x)
 
output
Integral(csc(e + f*x)/(a + b*tan(e + f*x)**2)**2, x)
 
3.1.71.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {\csc (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\text {Exception raised: ValueError} \]

input
integrate(csc(f*x+e)/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(b-a>0)', see `assume?` for more 
details)Is
 
3.1.71.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 255 vs. \(2 (98) = 196\).

Time = 0.54 (sec) , antiderivative size = 255, normalized size of antiderivative = 2.32 \[ \int \frac {\csc (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=-\frac {\frac {{\left (3 \, a b - 2 \, b^{2}\right )} \arctan \left (-\frac {a \cos \left (f x + e\right ) - b \cos \left (f x + e\right ) - b}{\sqrt {a b - b^{2}} \cos \left (f x + e\right ) + \sqrt {a b - b^{2}}}\right )}{{\left (a^{3} - a^{2} b\right )} \sqrt {a b - b^{2}}} + \frac {2 \, {\left (a b + \frac {a b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {2 \, b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}\right )}}{{\left (a^{3} - a^{2} b\right )} {\left (a + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {4 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}} - \frac {\log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right )}{a^{2}}}{2 \, f} \]

input
integrate(csc(f*x+e)/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")
 
output
-1/2*((3*a*b - 2*b^2)*arctan(-(a*cos(f*x + e) - b*cos(f*x + e) - b)/(sqrt( 
a*b - b^2)*cos(f*x + e) + sqrt(a*b - b^2)))/((a^3 - a^2*b)*sqrt(a*b - b^2) 
) + 2*(a*b + a*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2*b^2*(cos(f*x + 
e) - 1)/(cos(f*x + e) + 1))/((a^3 - a^2*b)*(a + 2*a*(cos(f*x + e) - 1)/(co 
s(f*x + e) + 1) - 4*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + 
 e) - 1)^2/(cos(f*x + e) + 1)^2)) - log(abs(-cos(f*x + e) + 1)/abs(cos(f*x 
 + e) + 1))/a^2)/f
 
3.1.71.9 Mupad [B] (verification not implemented)

Time = 13.09 (sec) , antiderivative size = 1140, normalized size of antiderivative = 10.36 \[ \int \frac {\csc (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{a^2\,f}-\frac {\frac {b}{a\,\left (a-b\right )}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (a\,b-2\,b^2\right )}{a^2\,\left (a-b\right )}}{f\,\left (a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+\left (4\,b-2\,a\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a\right )}+\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {\left (\frac {b^{3/2}\,{\left (3\,a-2\,b\right )}^3\,\left (2\,a^{10}-58\,a^9\,b+306\,a^8\,b^2-686\,a^7\,b^3+772\,a^6\,b^4-432\,a^5\,b^5+96\,a^4\,b^6\right )}{8\,a^6\,{\left (a-b\right )}^{9/2}\,\left (-a^5+3\,a^4\,b-3\,a^3\,b^2+a^2\,b^3\right )}+\frac {2\,\sqrt {b}\,\left (3\,a-2\,b\right )\,\left (9\,a^5\,b-63\,a^4\,b^2+158\,a^3\,b^3-188\,a^2\,b^4+108\,a\,b^5-24\,b^6\right )}{a^2\,{\left (a-b\right )}^{3/2}\,\left (-a^5+3\,a^4\,b-3\,a^3\,b^2+a^2\,b^3\right )}\right )\,\left (27\,a^5-259\,a^4\,b+820\,a^3\,b^2-1164\,a^2\,b^3+768\,a\,b^4-192\,b^5\right )}{2\,a^5\,{\left (a-b\right )}^{9/2}\,\left (16\,a^3-39\,a^2\,b+36\,a\,b^2-12\,b^3\right )}-\frac {\left (\frac {8\,\left (9\,a^2\,b^2-12\,a\,b^3+4\,b^4\right )}{-a^5+3\,a^4\,b-3\,a^3\,b^2+a^2\,b^3}-\frac {b\,{\left (3\,a-2\,b\right )}^2\,\left (2\,a^8-35\,a^7\,b+234\,a^6\,b^2-611\,a^5\,b^3+746\,a^4\,b^4-432\,a^3\,b^5+96\,a^2\,b^6\right )}{2\,a^4\,{\left (a-b\right )}^3\,\left (-a^5+3\,a^4\,b-3\,a^3\,b^2+a^2\,b^3\right )}\right )\,\left (2\,a^4-47\,a^3\,b+186\,a^2\,b^2-240\,a\,b^3+96\,b^4\right )}{a^5\,\sqrt {b}\,{\left (a-b\right )}^3\,\left (16\,a^3-39\,a^2\,b+36\,a\,b^2-12\,b^3\right )}\right )+\frac {\left (\frac {\sqrt {b}\,\left (3\,a-2\,b\right )\,\left (12\,a^5\,b-53\,a^4\,b^2+60\,a^3\,b^3-20\,a^2\,b^4\right )}{a^2\,{\left (a-b\right )}^{3/2}\,\left (a^5-2\,a^4\,b+a^3\,b^2\right )}+\frac {b^{3/2}\,{\left (3\,a-2\,b\right )}^3\,\left (4\,a^{10}-24\,a^9\,b+52\,a^8\,b^2-48\,a^7\,b^3+16\,a^6\,b^4\right )}{16\,a^6\,{\left (a-b\right )}^{9/2}\,\left (a^5-2\,a^4\,b+a^3\,b^2\right )}\right )\,\left (27\,a^5-259\,a^4\,b+820\,a^3\,b^2-1164\,a^2\,b^3+768\,a\,b^4-192\,b^5\right )}{2\,a^5\,{\left (a-b\right )}^{9/2}\,\left (16\,a^3-39\,a^2\,b+36\,a\,b^2-12\,b^3\right )}-\frac {\left (\frac {4\,\left (9\,a^2\,b^2-12\,a\,b^3+4\,b^4\right )}{a^5-2\,a^4\,b+a^3\,b^2}-\frac {b\,{\left (3\,a-2\,b\right )}^2\,\left (4\,a^8-36\,a^7\,b+96\,a^6\,b^2-96\,a^5\,b^3+32\,a^4\,b^4\right )}{4\,a^4\,{\left (a-b\right )}^3\,\left (a^5-2\,a^4\,b+a^3\,b^2\right )}\right )\,\left (2\,a^4-47\,a^3\,b+186\,a^2\,b^2-240\,a\,b^3+96\,b^4\right )}{a^5\,\sqrt {b}\,{\left (a-b\right )}^3\,\left (16\,a^3-39\,a^2\,b+36\,a\,b^2-12\,b^3\right )}\right )\,\left (4\,a^7\,{\left (a-b\right )}^{9/2}-12\,a^6\,b\,{\left (a-b\right )}^{9/2}-4\,a^4\,b^3\,{\left (a-b\right )}^{9/2}+12\,a^5\,b^2\,{\left (a-b\right )}^{9/2}\right )}{9\,a^2\,b-12\,a\,b^2+4\,b^3}\right )\,\left (3\,a-2\,b\right )}{2\,a^2\,f\,{\left (a-b\right )}^{3/2}} \]

input
int(1/(sin(e + f*x)*(a + b*tan(e + f*x)^2)^2),x)
 
output
log(tan(e/2 + (f*x)/2))/(a^2*f) - (b/(a*(a - b)) - (tan(e/2 + (f*x)/2)^2*( 
a*b - 2*b^2))/(a^2*(a - b)))/(f*(a - tan(e/2 + (f*x)/2)^2*(2*a - 4*b) + a* 
tan(e/2 + (f*x)/2)^4)) + (b^(1/2)*atan(((tan(e/2 + (f*x)/2)^2*((((b^(3/2)* 
(3*a - 2*b)^3*(2*a^10 - 58*a^9*b + 96*a^4*b^6 - 432*a^5*b^5 + 772*a^6*b^4 
- 686*a^7*b^3 + 306*a^8*b^2))/(8*a^6*(a - b)^(9/2)*(3*a^4*b - a^5 + a^2*b^ 
3 - 3*a^3*b^2)) + (2*b^(1/2)*(3*a - 2*b)*(108*a*b^5 + 9*a^5*b - 24*b^6 - 1 
88*a^2*b^4 + 158*a^3*b^3 - 63*a^4*b^2))/(a^2*(a - b)^(3/2)*(3*a^4*b - a^5 
+ a^2*b^3 - 3*a^3*b^2)))*(768*a*b^4 - 259*a^4*b + 27*a^5 - 192*b^5 - 1164* 
a^2*b^3 + 820*a^3*b^2))/(2*a^5*(a - b)^(9/2)*(36*a*b^2 - 39*a^2*b + 16*a^3 
 - 12*b^3)) - (((8*(4*b^4 - 12*a*b^3 + 9*a^2*b^2))/(3*a^4*b - a^5 + a^2*b^ 
3 - 3*a^3*b^2) - (b*(3*a - 2*b)^2*(2*a^8 - 35*a^7*b + 96*a^2*b^6 - 432*a^3 
*b^5 + 746*a^4*b^4 - 611*a^5*b^3 + 234*a^6*b^2))/(2*a^4*(a - b)^3*(3*a^4*b 
 - a^5 + a^2*b^3 - 3*a^3*b^2)))*(2*a^4 - 47*a^3*b - 240*a*b^3 + 96*b^4 + 1 
86*a^2*b^2))/(a^5*b^(1/2)*(a - b)^3*(36*a*b^2 - 39*a^2*b + 16*a^3 - 12*b^3 
))) + (((b^(1/2)*(3*a - 2*b)*(12*a^5*b - 20*a^2*b^4 + 60*a^3*b^3 - 53*a^4* 
b^2))/(a^2*(a - b)^(3/2)*(a^5 - 2*a^4*b + a^3*b^2)) + (b^(3/2)*(3*a - 2*b) 
^3*(4*a^10 - 24*a^9*b + 16*a^6*b^4 - 48*a^7*b^3 + 52*a^8*b^2))/(16*a^6*(a 
- b)^(9/2)*(a^5 - 2*a^4*b + a^3*b^2)))*(768*a*b^4 - 259*a^4*b + 27*a^5 - 1 
92*b^5 - 1164*a^2*b^3 + 820*a^3*b^2))/(2*a^5*(a - b)^(9/2)*(36*a*b^2 - 39* 
a^2*b + 16*a^3 - 12*b^3)) - (((4*(4*b^4 - 12*a*b^3 + 9*a^2*b^2))/(a^5 -...